package cn.coisini.controller.v1;

import cn.coisini.api.admin.AiControllerApi;
import cn.coisini.model.common.ai.service.DeepSeekService;
import cn.coisini.model.common.dtos.Result;
import lombok.RequiredArgsConstructor;
import org.springframework.ai.chat.model.ChatResponse;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;

/**
 * @author xiangshaw
 * Description: AI接口
 */
@RestController
@RequiredArgsConstructor
public class AiController implements AiControllerApi {

    private final DeepSeekService deepSeekService;
    @Override
    public Result<String> chat(String message) {
        return deepSeekService.chat(message);
    }

    @Override
    public Result<Flux<ChatResponse>> chatFlux(String message) {
        return deepSeekService.chatFlux(message);
    }
}
